﻿using AutoMapper;
using ManagementApi.Controllers;
using ManagementApi.Models;
using ManagementApi.Models.Account;
using ManagementApi.Models.App;
using ManagementApi.Models.Cms;
using ManagementApi.Models.Commander;
using ManagementApi.Models.Constructor;
using ManagementApi.Models.Corp;
using ManagementApi.Models.Device;
using ManagementApi.Models.Logs;
using ManagementApi.Models.Manage;
using ManagementApi.Models.Manage.CheckIn;
using ManagementApi.Models.Manage.ProjectCorp;
using ManagementApi.Models.Manage.ProjectGroup;
using ManagementApi.Models.Manage.ProjectGroupMember;
using ManagementApi.Models.Manage.ProjectSecurityDepositPaymentDetails;
using ManagementApi.Models.Manage.ProjectSecurityDepositRecords;
using ManagementApi.Models.Manage.ProjectSpecialAccount;
using ManagementApi.Models.Manager;
using ManagementApi.Models.Notify;
using ManagementApi.Models.Payroll;
using ManagementApi.Models.Person;
using ManagementApi.Models.Project;
using ManagementApi.Models.ProjectLockOut;
using ManagementApi.Models.SysAttachment;
using ManagementApi.Models.System;
using ManagementApi.Models.System.AppNotice;
using ManagementApi.Models.System.AuditLog;
using ManagementApi.Models.System.Dept;
using ManagementApi.Models.System.Flow;
using ManagementApi.Models.System.Menu;
using ManagementApi.Models.System.ProjectCheckinDeviceCommandLog;
using ManagementApi.Models.System.ProjectCorpWageAuth;
using ManagementApi.Models.System.ProjectSpecialAccount;
using ManagementApi.Models.System.Role;
using ManagementApi.Models.System.Setting;
using ManagementApi.Models.System.TableLog;
using ManagementApi.Models.System.User;
using ManagementApi.Models.Template;
using ManagementApi.Models.WeiXin;
using ManagementApi.Services.Import;
using ManagementApi.Services.ProjectImport;
using Modules;
using Modules.BankSpecialAccount.Entitys;
using Modules.CheckIn.Entitys;
using Modules.Cms.Entitys;
using Modules.Constructor;
using Modules.Corp;
using Modules.Device.Entitys;
using Modules.Entitys;
using Modules.FaceScan.Entitys;
using Modules.Person;
using Modules.Project;
using Modules.Project.Entitys;
using Modules.Project.Models;
using Modules.SMS.Entitys;
using Modules.System.AppNotice;
using Modules.System.Attachment;
using Modules.System.Dept;
using Modules.System.Menu;
using Modules.System.Role;
using Modules.System.Security;
using Modules.System.Settings.Entitys;
using Modules.System.User;
using System.Net.Mail;

namespace ManagementApi.Converts
{
    public class AutoMapperProfiles : Profile
    {
        /// <summary>
        /// Mapper映射
        /// </summary>
        public AutoMapperProfiles()
        {
            #region 菜单

            CreateMap<SysMenu, RouteDto>();

            CreateMap<MenuEditForm, SysMenu>();

            CreateMap<SysMenu, MenuEditForm>();

            #endregion 菜单

            #region 主管单位

            CreateMap<SysDept, DeptDto>();

            CreateMap<SysDept, DeptEditForm>();

            CreateMap<DeptEditForm, SysDept>();

            #endregion 主管单位

            #region 角色

            CreateMap<SysRole, RoleDto>();

            CreateMap<SysRole, RoleEditForm>();

            CreateMap<RoleEditForm, SysRole>();

            #endregion 角色

            #region 系统用户

            //系统用户
            CreateMap<SysUser, UserDto>();

            CreateMap<SysUser, UserEditForm>();

            CreateMap<UserEditForm, SysUser>();

            //登陆安全相关
            CreateMap<UserSecurityEditForm, SysSecurity>();
            CreateMap<SecurityEditForm, SysSecurity>();

            #endregion 系统用户

            #region 企业

            CreateMap<CorpInfo, CorpInfoDto>();
            CreateMap<CorpInfo, CorpCreateForm>();
            CreateMap<CorpCreateForm, CorpInfo>();

            #endregion 企业

            #region 项目管理员

            CreateMap<ManageCreateForm, ManagerInfo>();

            #endregion 项目管理员

            #region 项目

            CreateMap<ProjectCheckInForm, ProjectInfo>();
            CreateMap<ProjectRegisterForm, ProjectInfo>();
            CreateMap<ProjectInfo, ProjectInfoDto>();
            CreateMap<ProjectInfo, ProjectCheckInForm>();
            CreateMap<ProjectInfo, ProjectRegisterForm>();
            CreateMap<ProjectUpdateApplyForm, ProjectInfo>();
            CreateMap<ProjectUpdateApplyForm, ProjectUpdateApply>();
            CreateMap<ProjectUpdateApply, ProjectUpdateApplyForm>();
            CreateMap<ProjectInfo, ProjectUpdateApply>();
            CreateMap<ProjectInfo, ProjectBaseInfo>();
            CreateMap<ProjectInfo, ProjectCompletForm>();
            CreateMap<ProjectCompletForm, ProjectInfo>();

            #endregion 项目

            #region 项目完工申请

            CreateMap<ProjectCompleted, ProjectCompletedDto>();
            CreateMap<ProjectCompletedEditForm, ProjectCompleted>();

            #endregion 项目完工申请

            #region 导入项目

            CreateMap<ProjectImportForm, ProjectImportDto>();

            #endregion 导入项目

            #region 劳务班组

            CreateMap<ProjectGroup, ProjectGroupDto>();
            CreateMap<ProjectGroup, ProjectGroupEditForm>();
            CreateMap<ProjectGroupEditForm, ProjectGroup>();

            #endregion 劳务班组

            #region 班组成员

            CreateMap<ProjectGroupMember, ProjectGroupMemberDto>();
            CreateMap<ProjectGroupMember, ProjectGroupMemberEditForm>();
            CreateMap<ProjectGroupMemberEditForm, ProjectGroupMember>();
            CreateMap<ProjectGroupMemberDto, ProjectGroupMemberEditForm>();

            #endregion 班组成员

            #region 项目参建单位

            CreateMap<ProjectCorp, ProjectCorpEditForm>();
            CreateMap<ProjectCorpEditForm, ProjectCorp>();
            CreateMap<ProjectCorp, ProjectCorpDto>();
            CreateMap<ProjectCorpEditForm, CorpInfo>();

            #endregion 项目参建单位

            #region 人员

            CreateMap<PersonInfo, PersonInfoDto>();
            CreateMap<PersonEditForm, PersonInfo>();
            CreateMap<PersonInfo, PersonEditForm>();
            CreateMap<PersonCreateForm, PersonEditForm>();
            CreateMap<PersonUpdateForm, PersonInfo>();
            CreateMap<PersonCreateForm, PersonInfo>();
            CreateMap<PersonInfo, ReadCardReport>();

            #endregion 人员

            #region 银行信息

            CreateMap<PersonBank, PersonBankDto>();
            CreateMap<PersonBankEditForm, PersonBank>();
            CreateMap<PersonBank, PersonBankEditForm>();

            #endregion 银行信息

            #region 专户管理

            CreateMap<BankSpecialAccountInfo, ProjectSpecialAccountDto>();
            CreateMap<BankSpecialAccountInfo, ReviewBankAccountDto>();
            CreateMap<ProjectSpecialAccountAuditForm, BankSpecialAccountInfo>();
            CreateMap<ProjectSpecialAccountEditForm, BankSpecialAccountInfo>();
            CreateMap<BankSpecialAccountInfo, ProjectSpecialAccountEditForm>();
            CreateMap<ProjectSpecialAccountExamineForm, BankSpecialAccountInfo>();
            CreateMap<ProjectSpecialAccountStatusForm, BankSpecialAccountInfo>();
            CreateMap<BankSpecialAccountInfo, ProjectSpecialAccountProjectDto>();
            CreateMap<BankSpecialAccountPaymentDetails, ProjectSpecialAccountPaymentDetailsDto>();
            CreateMap<BankSpecialAccountPayment, ProjectSpecialAccountPaymentDto>();
            CreateMap<ProjectSpecialAccountPaymentEditForm, BankSpecialAccountPayment>();
            CreateMap<ProjectSpecialAccountPaymentDetailsEditForm, BankSpecialAccountPaymentDetails>();

            #endregion 专户管理

            #region 通知

            CreateMap<SysNotify, SysNotifyDto>();
            CreateMap<SysNotifyEditForm, SysNotify>();
            CreateMap<SysNotify, SysNotifyEditForm>();
            CreateMap<WorkerNotify, WorkerNotifyDto>();
            CreateMap<WorkerNotifyEditForm, WorkerNotify>();
            CreateMap<WorkerNotify, WorkerNotifyEditForm>();

            #endregion 通知

            #region 工资单

            CreateMap<WagePayroll, PayrollDto>();
            CreateMap<PayrollEditForm, WagePayroll>();
            CreateMap<WagePayroll, PayrollEditForm>();
            CreateMap<PayrollDetailImportForm, PayrollDetailImportDto>();

            #endregion 工资单

            #region 考勤设置

            CreateMap<CheckinWageStatusSettingEditForm, CheckinWageStatusSettings>();
            CreateMap<CheckinWageStatusSettings, CheckinWageStatusSettingDto>();

            #endregion 考勤设置

            #region 工资单当月最大限额设置

            CreateMap<WageMonthAmountSettingsEditForm, WageMonthAmountSettings>();
            CreateMap<WageMonthAmountSettings, WageMonthAmountSettingsDto>();

            #endregion 工资单当月最大限额设置

            #region 短信发送内容设置（找回密码）

            CreateMap<RetrievePasswordSettingEditForm, RetrievePasswordSetting>();
            CreateMap<RetrievePasswordSetting, RetrievePasswordSettingDto>();

            #endregion 短信发送内容设置（找回密码）

            #region 项目管理员

            CreateMap<ManagerInfo, ManagerDto>();

            #endregion 项目管理员

            #region 流程

            CreateMap<SysFlow, FlowDto>();
            CreateMap<SysFlow, FlowEditForm>();
            CreateMap<FlowEditForm, SysFlow>();
            CreateMap<SysFlowEngine, FlowEngineDto>();
            CreateMap<SysFlowEngine, FlowEngineEditForm>();
            CreateMap<FlowEngineEditForm, SysFlowEngine>();

            #endregion 流程

            #region 审核日志

            CreateMap<SysAuditLog, AuditLogDto>();

            #endregion 审核日志

            #region 指挥部

            CreateMap<CommanderEditForm, CommanderInfo>();
            CreateMap<CommanderCreateForm, CommanderInfo>();
            CreateMap<CommanderInfo, CommanderEditForm>();
            CreateMap<CommanderInfo, CommanderDto>();

            #endregion 指挥部

            #region 设备

            CreateMap<CardReader, CardReaderDeviceDto>();
            CreateMap<CardReaderDeviceEditForm, CardReader>();
            CreateMap<CardReader, CardReaderDeviceEditForm>();

            CreateMap<AppCheckinAuth, AppCheckinAuthEditForm>();
            CreateMap<AppCheckinAuthEditForm, AppCheckinAuth>();
            CreateMap<AppCheckinAuth, AppCheckinAuthDto>();

            #endregion 设备

            #region 建设单位

            CreateMap<ConstructorInfo, ConstructorDto>();
            CreateMap<ConstructorInfo, ConstructorCreateForm>();
            CreateMap<ConstructorCreateForm, ConstructorInfo>();

            #endregion 建设单位

            #region 考勤记录

            CreateMap<CheckInDetail, CheckInDetailDto>();
            CreateMap<CheckInDetail, CheckInDetailEditForm>();
            CreateMap<CheckInDetailEditForm, CheckInDetail>();
            CreateMap<CheckInDetail, CheckInDetailForm>();

            #endregion 考勤记录

            #region 人员身份证及比对照片

            CreateMap<FacePhoto, PersonFaceDto>();
            CreateMap<PersonFaceScanRecordEditForm, FaceScanRecord>();
            CreateMap<FaceScanRecord, PersonFaceScanRecordDto>();

            #endregion 人员身份证及比对照片

            #region App通知公告

            CreateMap<AppNoticeInfo, AppNoticeInfoDto>();
            CreateMap<AppNoticeInfoEditForm, AppNoticeInfo>();

            #endregion App通知公告

            #region 项目考勤设备管理

            CreateMap<CheckinDevice, CheckInDeviceDto>();
            CreateMap<CheckinDevice, CheckInDeviceEditForm>();
            CreateMap<CheckInDeviceEditForm, CheckinDevice>();

            #endregion 项目考勤设备管理

            #region 项目考勤设备命令下发记录

            CreateMap<CheckinDeviceCommand, ProjectCheckinDeviceCommandDto>();

            #endregion 项目考勤设备命令下发记录

            #region 保证金账户

            CreateMap<ProjectGuaranteeExpenditure, ProjectGuaranteeExpenditureDto>();
            CreateMap<ProjectGuaranteeExpenditureEditForm, ProjectGuaranteeExpenditure>();

            CreateMap<ProjectGuaranteeAccount, ProjectGuaranteeAccountDto>();
            CreateMap<ProjectGuaranteeAccountEditForm, ProjectGuaranteeAccount>();

            CreateMap<ProjectGuaranteeIncome, ProjectGuaranteeIncomeDto>();
            CreateMap<ProjectGuaranteeIncomeEditForm, ProjectGuaranteeIncome>();

            CreateMap<ProjectGuaranteePayment, ProjectGuaranteePaymentDto>();
            CreateMap<ProjectGuaranteePaymentEditForm, ProjectGuaranteePayment>();

            CreateMap<ProjectGuaranteeRefund, ProjectGuaranteeRefundDto>();
            CreateMap<ProjectGuaranteeRefundEditForm, ProjectGuaranteeRefund>();
            CreateMap<ProjectGuaranteeRefundAuditForm, ProjectGuaranteeRefund>();

            #endregion 保证金账户

            #region 考勤设备下发

            CreateMap<PersonInfo, AddPersonJobs>();

            #endregion 考勤设备下发

            #region 保证金收支信息

            CreateMap<ProjectSecurityDepositRecords, ProjectSecurityDepositRecordsDto>();
            CreateMap<ProjectSecurityDepositRecordsEditForm, ProjectSecurityDepositRecords>();
            CreateMap<ProjectSecurityDepositRecords, ProjectSecurityDepositRecordsEditForm>();

            #endregion 保证金收支信息

            #region 保证金支付明细

            CreateMap<ProjectSecurityDepositPaymentDetails, ProjectSecurityDepositPaymentDetailsDto>();
            CreateMap<ProjectSecurityDepositPaymentDetailsEditForm, ProjectSecurityDepositPaymentDetails>();
            CreateMap<ProjectSecurityDepositPaymentDetails, ProjectSecurityDepositPaymentDetailsEditForm>();

            #endregion 保证金支付明细

            #region 系统操作日志

            CreateMap<SysTableLog, SysTableLogForm>();
            CreateMap<SysTableLog, SysTableLogDto>();

            #endregion 系统操作日志

            #region 合同信息

            CreateMap<PersonContractForm, PersonCorpContract>();
            CreateMap<PersonCorpContract, PersonContractForm>();
            CreateMap<PersonCorpContract, PersonContractDto>();

            #endregion 合同信息

            #region 模板

            CreateMap<SysTemplate, SysTemplateDto>();

            #endregion 模板

            #region 附件

            CreateMap<AttachmentInfo, SysAttachmentDto>();

            #endregion 附件

            #region 人员证书

            CreateMap<PersonCertificateForm, PersonCertificate>();
            CreateMap<PersonCertificateSpecialityForm, PersonCertificateSpeciality>();

            CreateMap<PersonCertificate, PersonCertificateForm>();
            CreateMap<PersonCertificateSpeciality, PersonCertificateSpecialityForm>();

            #endregion 人员证书

            #region 项目停复工管理

            CreateMap<ProjectLockOut, ProjectLockOutDto>();
            CreateMap<ProjectLockOutEditForm, ProjectLockOut>();
            CreateMap<ProjectLockOut, ProjectLockOutEditForm>();

            #endregion 项目停复工管理

            #region 项目参建企业非正常工资单授权

            CreateMap<ProjectCorpWageAuth, ProjectCorpWageAuthEditForm>();
            CreateMap<ProjectCorpWageAuthEditForm, ProjectCorpWageAuth>();
            CreateMap<ProjectCorpWageAuth, ProjectCorpWageAuthDto>();

            #endregion 项目参建企业非正常工资单授权

            #region 项目月统计报表

            CreateMap<ReportProjectMonth, ReportProjectMonthEditForm>();
            CreateMap<ReportProjectMonthEditForm, ReportProjectMonth>();
            CreateMap<ReportProjectMonth, ReportProjectMonthDto>();

            #endregion 项目月统计报表

            #region 预警记录表

            CreateMap<SysEarlyWarning, SysEarlyWarningEditForm>();
            CreateMap<SysEarlyWarningEditForm, SysEarlyWarning>();
            CreateMap<SysEarlyWarning, SysEarlyWarningDto>();

            #endregion 预警记录表

            #region 项目解上锁记录

            CreateMap<ProjectLockLog, ProjectLockLogEditForm>();
            CreateMap<ProjectLockLogEditForm, ProjectLockLog>();
            CreateMap<ProjectLockLog, ProjectLockLogDto>();

            #endregion 项目解上锁记录

            #region 工资单设置

            CreateMap<WagePayrollSetting, WagePayrollSettingEditForm>();
            CreateMap<WagePayrollSettingEditForm, WagePayrollSetting>();
            CreateMap<WagePayrollSetting, WagePayrollSettingDto>();

            #endregion 工资单设置

            #region 工资卡导入

            CreateMap<PersonBankImportForm, PersonBankImportDto>();

            #endregion 工资卡导入

            #region app版本控制

            CreateMap<AppVersion, AppVersionEditForm>();
            CreateMap<AppVersionEditForm, AppVersion>();
            CreateMap<AppVersion, AppVersionDto>();

            #endregion app版本控制

            #region 各应用log4net调试日志

            CreateMap<Log4netDebug, Log4netDebugEditForm>();
            CreateMap<Log4netDebugEditForm, Log4netDebug>();
            CreateMap<Log4netDebug, Log4netDebugDto>();

            #endregion 各应用log4net调试日志

            #region 各应用log4net错误日志

            CreateMap<Log4netError, Log4netErrorEditForm>();
            CreateMap<Log4netErrorEditForm, Log4netError>();
            CreateMap<Log4netError, Log4netErrorDto>();

            #endregion 各应用log4net错误日志

            #region 各应用log4net信息日志

            CreateMap<Log4netInfo, Log4netInfoEditForm>();
            CreateMap<Log4netInfoEditForm, Log4netInfo>();
            CreateMap<Log4netInfo, Log4netInfoDto>();

            #endregion 各应用log4net信息日志

            #region 各应用log4net警告日志

            CreateMap<Log4netWarning, Log4netWarningEditForm>();
            CreateMap<Log4netWarningEditForm, Log4netWarning>();
            CreateMap<Log4netWarning, Log4netWarningDto>();

            #endregion 各应用log4net警告日志

            #region 首页

            CreateMap<HomeStatistic, HomeStatisticDto>();

            #endregion 首页

            #region 测试

            CreateMap<class1, class2>();

            #endregion 测试

            #region 短信发送记录
            CreateMap<SmsSendLog, SmsSendLogDto>();
            #endregion

            #region 经销商管理
            CreateMap<CmsDealer, CmsDealerDto>();
            CreateMap<CmsDealer, CmsDealerEditForm>();
            CreateMap<CmsDealerEditForm, CmsDealer>();
            #endregion

            #region 出库单
            CreateMap<CmsOrder, CmsOrderDto>();
            CreateMap<CmsOrder, CmsOrderEditForm>();
            CreateMap<CmsOrderEditForm, CmsOrder>();
            #endregion

            #region 客户信息
            CreateMap<CmsCustom, CmsCustomDto>();
            CreateMap<CmsCustom, CmsCustomEditForm>();
            CreateMap<CmsCustomEditForm, CmsCustom>();
            #endregion

            #region 客户租赁信息
            CreateMap<CmsCustomLease, CmsCustomLeaseDto>();
            CreateMap<CmsCustomLease, CmsCustomLeaseEditForm>();
            CreateMap<CmsCustomLeaseEditForm, CmsCustomLease>();
            #endregion

            #region 经销商
            CreateMap<SysUser, UserInfoDto>();
            #endregion

            CreateMap<CreateLeaseForm, CmsCustomLease>();
        }
    }
}